//
//  WCTSetTextTool.m
//  WC
//
//  Created by wsj2015 on 16/2/19.
//  Copyright © 2016年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "WCTSetTextTool.h"

@implementation WCTSetTextTool



+ (void)setTextView:(UIView *)textView text:(NSString *)text initText:(NSString *)initText
{
    if ([textView respondsToSelector:@selector(setText:)]){
        UILabel *label = (UILabel *)textView;
        if (text!=nil) {
            label.text = [NSString stringWithFormat:@"%@",text];
            NSRange range =[[NSString stringWithFormat:@"%@",text] rangeOfString:@"(null)"];
            if (range.length>0) {
                
             label.text =[text stringByReplacingCharactersInRange:range withString:@""];
            }
            if ([[NSString stringWithFormat:@"%@",text] isEqualToString:@"(null)"]) {
                label.text =@"";
            }
        }else{
            if (initText ==nil) {
                label.text = @"";
            }
            label.text = initText;
          
        }
    }
   
    

}



@end
